﻿using System;

namespace AsyncLoggers
{
    internal class ActionCommand : Command
    {
        private readonly Action _action;

        public ActionCommand(Action action)
        {
            if (action == null) throw new ArgumentNullException("action");

            _action = action;
        }

        public override void Execute()
        {
            _action.Invoke();
        }
    }
}